<#import "/lib/composition.ftl" as ui />
<#import "/lib/spring.ftl" as spring />

<@ui.composition "/base.ftl">
  <#assign content in ui>
    <div id="page-title">
      <div id="page-title-inner">
        <div class="container">
          <h2 style="margin-left: -40px;">Administration</h2>
        </div>
      </div>
    </div>
  
    <div id="wrapper">
      <div class="container">           
        <hr>
        
        <div class="row">         
          <div class="span12">
            <div class="title-out"></div>
            
            <div class="row">     
              <#list models as model>                  
                <div class="span3" style="margin-bottom: 20px;"> 
                  <div class="picture">
                    <form id="deleteForm_${model.docId}" action="<@spring.url '/admin/asdfgh/deleteModel' />" style="text-align: right; margin-bottom: 0px;" method="post">
                      <input type="hidden" name="id" value="${model.docId}" />
                      <input type="hidden" name="rev" value="${model.rev}" />
                      
                      <a href="#" onclick="document.getElementById('deleteForm_${model.docId}').submit();"><i class="icon-remove" style="padding-right: 5px;"></i></a>                                                   
                    </form>
                  
                    <a href="<@spring.url '/attachment/${model.docId}?name=${(model.images[0].fullImage)!}'/>" rel="image">
                      <img src="<@spring.url '/attachment/${model.docId}?name=${(model.images[0].previewImage)!}'/>">
                    </a>
                    <div class="item-description">
                      <h4 style="text-align: center;">${model.title}</h4>
                      <hr style="margin-bottom: 0px; margin-top: 0px;" />
                      <h4 style="text-align: center;"><a href="<@spring.url '/item/${model.docId}'/>">Details...</a></h4>
                      <h4 style="text-align: center;"><a href="<@spring.url '/item/${model.docId}'/>#disqus_thread">Comments</a></h4>
                      <h4 style="text-align: center;"><a href="<@spring.url '/admin/asdfgh/editModel/${model.docId}'/>">Edit</a></h4>                        
                    </div>
                  </div>          
                </div>
              </#list>
            </div>
          </div>
        </div>
        
        <ul>
          <li><a href="<@spring.url '/admin/asdfgh/editModel/new' />">Добавить новую модель</a></li>
        </ul>          
          
        <div style="height:700px;">&nbsp;</div>        
      </div>
    </div>
  </#assign>
</@ui.composition>
